﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace University.Workshop.Presenters.WaterPurchase
{
    public class PresenterFirstStepForModifyWaterPurchase
    {
        IFirstStepForModifyWaterPurchase view;

        public PresenterFirstStepForModifyWaterPurchase(IFirstStepForModifyWaterPurchase view)
        {
            this.view = view;
        }

        public void UpdateData()
        {
            view.LicencePlate = view.WaterPurchaseToModify.LicencePlate;

            Model.Cistern cistern = new Model.Cistern { LicencePlate = view.WaterPurchaseToModify.LicencePlate };
            cistern = University.Workshop.Business.ManagerCistern.GetCisternByPlate(cistern);
            //Puede devolver un null

            view.Capacity = cistern.Capacity.ToString();

            view.PersonLastNames = cistern.LastNameDriver;
            view.PersonNames = cistern.NameDriver;
        }

        // No se cargan los datos porque solo son para mostrarlos, no modificarlos
        public void ChargeDataWaterPurchase()
        {
        }
    }
}
